﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Arbol
{
    static class Program
    {
        /// <summary>
        /// Punto de entrada principal para la aplicación.
        /// </summary>
        [STAThread]
        static void Main(String[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
            // Create instance of class FPTree

		FPtree newFPtree = new FPtree(args);

		// Read data to be mined from file

		newFPtree.inputDataSet();

		// Reorder and prune input data according to frequency of single 
		//attributes	
		newFPtree.idInputDataOrdering();
		newFPtree.recastInputDataAndPruneUnsupportedAtts();
		newFPtree.setNumOneItemSets();
	//newFPtree.outputDataArray();

			// Build initial FP-tree

        double time1 = (double)System.Environment.TickCount;
		newFPtree.createFPtree();
        newFPtree.outputDuration(time1, (double)System.Environment.TickCount);
	newFPtree.outputFPtreeStorage();
	newFPtree.outputFPtree();
	//newFPtree.outputItemPrefixSubtree();

		// Mine FP-tree

    time1 = (double)System.Environment.TickCount;
		newFPtree.startMining();
        newFPtree.outputDuration(time1, (double)System.Environment.TickCount);
	newFPtree.outputStorage();
	newFPtree.outputNumFreqSets();
	//newFPtree.outputTtree(); // Frequent sets arec stored in this structure
	newFPtree.outputRules();
		}
        }
    }
